import java.util.Scanner;

public class Fect {
    public static void main(String[] args) {
        int N;
        int sum = 0;
        int fec = 1;
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        for (int i = 1; i <= N; i++) {
            fec = 1;
            for (int j = 1; j <= i ; j++) {
                fec *= j;
            }
            System.out.println(fec);
            sum += fec;
        }
        System.out.println("1! + 2! +...+"+N+"! = "+sum);
    }
}
